<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>打印直角三角形</title>
</head>

<body>
    <script>
        var rows = parseInt(prompt("请输入要打印的行数："));

        for (var i = 1; i <= rows; i++) {
            var row = '';
            for (var j = 1; j <= i; j++) {
                row += '* ';
            }
            document.write(row + '<br>');
        }
    </script>
</body>

</html>